using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class Images
	{
        private int _RowNum;

        public int RowNum
        {
            get { return _RowNum; }
            set { _RowNum = value; }
        }

		private int _Id;

		public int Id
		{
			get { return _Id; }
			set { _Id = value; }
		}

		private string _Title;

		public string Title
		{
			get { return _Title; }
			set { _Title = value; }
		}

		private string _ImgPath;

		public string ImgPath
		{
			get { return _ImgPath; }
			set { _ImgPath = value; }
		}

		private string _ClickUrl;

		public string ClickUrl
		{
			get { return _ClickUrl; }
			set { _ClickUrl = value; }
		}

		private Nullable<int> _ImgType;

		public Nullable<int> ImgType
		{
			get { return _ImgType; }
			set { _ImgType = value; }
		}

		private Nullable<bool> _IsActive;

		public Nullable<bool> IsActive
		{
			get { return _IsActive; }
			set { _IsActive = value; }
		}

		private Nullable<int> _Sorted;

		public Nullable<int> Sorted
		{
			get { return _Sorted; }
			set { _Sorted = value; }
		}

		public Images()
		{ }

		public Images(int Id,string Title,string ImgPath,string ClickUrl,Nullable<int> ImgType,Nullable<bool> IsActive,Nullable<int> Sorted)
		{
			this.Id = Id;
			this.Title = Title;
			this.ImgPath = ImgPath;
			this.ClickUrl = ClickUrl;
			this.ImgType = ImgType;
			this.IsActive = IsActive;
			this.Sorted = Sorted;
		}

		public override string ToString()
		{
			return "Id = " + Id.ToString() + ",Title = " + Title + ",ImgPath = " + ImgPath + ",ClickUrl = " + ClickUrl + ",ImgType = " + ImgType.ToString() + ",IsActive = " + IsActive.ToString() + ",Sorted = " + Sorted.ToString();
		}

		public class IdComparer : System.Collections.Generic.IComparer<Images>
		{
			public SorterMode SorterMode;
			public IdComparer()
			{ }
			public IdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Images> Membres
			int System.Collections.Generic.IComparer<Images>.Compare(Images x, Images y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Id.CompareTo(x.Id);
				}
				else
				{
					return x.Id.CompareTo(y.Id);
				}
			}
			#endregion
		}
		public class TitleComparer : System.Collections.Generic.IComparer<Images>
		{
			public SorterMode SorterMode;
			public TitleComparer()
			{ }
			public TitleComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Images> Membres
			int System.Collections.Generic.IComparer<Images>.Compare(Images x, Images y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Title.CompareTo(x.Title);
				}
				else
				{
					return x.Title.CompareTo(y.Title);
				}
			}
			#endregion
		}
		public class ImgPathComparer : System.Collections.Generic.IComparer<Images>
		{
			public SorterMode SorterMode;
			public ImgPathComparer()
			{ }
			public ImgPathComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Images> Membres
			int System.Collections.Generic.IComparer<Images>.Compare(Images x, Images y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ImgPath.CompareTo(x.ImgPath);
				}
				else
				{
					return x.ImgPath.CompareTo(y.ImgPath);
				}
			}
			#endregion
		}
		public class ClickUrlComparer : System.Collections.Generic.IComparer<Images>
		{
			public SorterMode SorterMode;
			public ClickUrlComparer()
			{ }
			public ClickUrlComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Images> Membres
			int System.Collections.Generic.IComparer<Images>.Compare(Images x, Images y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ClickUrl.CompareTo(x.ClickUrl);
				}
				else
				{
					return x.ClickUrl.CompareTo(y.ClickUrl);
				}
			}
			#endregion
		}
	}
}
